Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] alternative split devices #417

Closed
wants to merge 28 commits into from
Closed

Conversation

umlaeute
Copy link
Owner

this is just an alternative branch to #359

it's main purpose is to keep the possibility for joined devices, pulling in the changes from #359 every now and then.

this PR is not very actively pursued. it's only a PR to get GitHub-actions (without changing the workflows-configuration)

vicamo and others added 24 commits March 13, 2021 19:55
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
V4L1 has been completely removed from kernel since 2.6.39.
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
With this change, output_nr will be allocated and deallocated as
capture_nr is, but currently saved with no other reference to it.

Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Since now both output_nr and capture_nr are meaningful, don't return
either of them.

Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Converting function v4l2loopback_cd2dev and v4l2loopback_getdevice
searches v4l2loopback_index_idr with device number retrieved from
video_device drvdata, but this could be time consuming and creates
unecessary complexity. And since we may need to retrieve
v4l2_loopback_device address from callbacks shared between capture and
output devices, this patch reuses video_device drvdata instead of struct
member offsets.

Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Also use V4L2_CAP_DEVICE_CAPS to detect this instead of hardcoded kernel
version.

Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Since we have already instantiated an output video device, use its `num`
field instead.

Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
@umlaeute umlaeute changed the base branch from main to develop March 18, 2021 09:39
@vicamo
Copy link
Contributor

vicamo commented Mar 19, 2021

Hi, I'd like to point out that struct vb2_queue has a streaming member, and vb2_core_streamon called in vb2_streamon called in vb2_ioctl_streamon would check if it's already in streaming, so it's impossible to share a struct vb2_queue between capture/output because VIDIOC_STREAMON cannot be called twice. So if you'd like to use videobuf2 queue/buf management with joined devices, you'll cannot use these ioctl helper functions, and you cannot use videobuf2 provided fops helper functions directly, either. They check vdev->queue for most calls. You'll need various work-arounds for very detailed implementation level limitations. It's going to be a mess.

@umlaeute
Copy link
Owner Author

i think #268 (comment) made it clear that joint devices is not sustainable anyhow.

I'm therefore closing this wip-pr.

the feature/split-devices branch has been rebooted by force-push to be based on your PR #359. (please sync to that as well :-))

(for reference sake, there's another branch that keeps the original content of this PR)

@umlaeute umlaeute closed this Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants